Compare data from the Disdrometer and Rain GaugeΒΆ

import xarray as xr
import hvplot.xarray
import hvplot.pandas
import pandas as pd
import holoviews as hv
from distributed import Client, LocalCluster
hv.extension('bokeh')

Spin up a Dask ClusterΒΆ

cluster = LocalCluster()
client = Client(cluster)
client
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-7gggry14', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-gu2trvj7', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-fosyqxv1', purging
distributed.diskutils - INFO - Found stale lock file and directory '/Users/mgrover/git_repos/SAILS-radar-analysis/notebooks/precipitation-exploration/dask-worker-space/worker-s50t2e4t', purging

Client

Client-17a27cdc-afb3-11ec-9549-acde48001122

Connection method: Cluster object Cluster type: distributed.LocalCluster
Dashboard: http://127.0.0.1:8787/status

Cluster Info

Read in the dataΒΆ

Here, we use data from:

  • a disdrometer (datastream: gucldM1.b1)

  • a rain gauge (datastream: gucwbpluvio2M1.a1)

We use all the data available, you can query from this website: https://adc.arm.gov/discovery/#/

disdrometer_ds = xr.open_mfdataset('../../data/disdrometer/*')
gauge_ds = xr.open_mfdataset('../../data/rain-gauge/*')

Visualize the DataΒΆ

We use hvplot here to plot an interactive view of our data, utilizing rasterize to dynamically view our large datasets

from bokeh.models import DatetimeTickFormatter

def apply_formatter(plot, element):
    plot.handles['xaxis'].formatter = DatetimeTickFormatter(hours='%m/%d/%Y \n %H:%M',
                                                            minutes='%m/%d/%Y \n %H:%M',
                                                            hourmin='%m/%d/%Y \n %H:%M',
                                                            days='%m/%d/%Y \n %H:%M',
                                                            months='%m/%d/%Y \n %H:%M')
snow_rate_plot = disdrometer_ds.snow_depth_intensity.hvplot.line(ylim=(0, 350), rasterize=True).opts(hooks=[apply_formatter])
bucket_accumulation = gauge_ds.intensity_rtnrt.hvplot.line(ylim=(0, 350), rasterize=True).opts(hooks=[apply_formatter])

View our Final VisualizationΒΆ

We can combine these into a single column of plots, matching the views/colorbars

(snow_rate_plot + bucket_accumulation).cols(1)